Skip to content

Parse RFC 9651-like date headers - #37224

Merged
bclozel merged 1 commit into
spring-projects:mainfrom
sabberworm:feat/parse-rfc9651-dates
Sep 4, 2026
Merged

bclozel merged 1 commit into
spring-projects:mainfrom
sabberworm:feat/parse-rfc9651-dates

Conversation

@sabberworm

Copy link
Copy Markdown
Contributor

RFC 9651 specifies @«timestamp» as a new format for date headers. The Deprecation header as specified in RFC 9745, for example, makes use of it. Make sure this can be parsed using HttpHeaders#getFirstDate and HttpHeaders#getFirstZonedDateTime.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 1, 2026
@bclozel

bclozel commented Sep 1, 2026

Copy link
Copy Markdown
Member

RFC 9651 ships way more than that. Is there a particular need to support this feature in a standalone fashion?
Are you encountering a particular case in production that requires such support? Can you share which client or server is involved ?

@sabberworm

sabberworm commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor Author

RFC 9651 ships way more than that

@bclozel true, but HttpHeaders currently has no convenience methods for data types specified in RFC 9651 other than dates. Whether it makes sense to add these is a separate discussion. The case for extending the existing methods for dates to parse all possible date formats including RFC 9651 is much stronger, IMHO.

My use-case is that I want to alert if the API we consume is deprecated. I want to increase the alert severity depending on how far in the future the deprecation is scheduled for, which is why I need to parse the date in the Deprecated header.

Some of the API I consume uses the draft version of the Deprecated header, which uses a date format currently supported by HttpHeaders. Ideally I would like to parse both using the same code path, which is why I think this belongs in the framework.

@bclozel bclozel self-assigned this Sep 4, 2026
@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 4, 2026
@bclozel bclozel added this to the 7.1.0-M2 milestone Sep 4, 2026
RFC 9651 specifies @«timestamp» as a new format for date headers.
The Deprecation header as specified in RFC 9745, for example, makes use of it.
Make sure this can be parsed using `HttpHeaders#getFirstDate` and `HttpHeaders#getFirstZonedDateTime`

Signed-off-by: Raphael Schweikert <any@sabberworm.com>
@bclozel
bclozel force-pushed the feat/parse-rfc9651-dates branch from a76e967 to 130b0ec Compare September 4, 2026 12:38
@bclozel
bclozel merged commit 130b0ec into spring-projects:main Sep 4, 2026
1 check passed
@bclozel

bclozel commented Sep 4, 2026

Copy link
Copy Markdown
Member

Thanks @sabberworm - with this change, we're not committing to RFC 9651 (because there is a lot to unpack there), but the use case makes sense.

@sabberworm
sabberworm deleted the feat/parse-rfc9651-dates branch September 24, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants